/**
*@Author: QWP
*@Description: 审核相关接口
*@Date 2024-08-06 19:04
*/
import request from '@/http'

// 提交审核 
// businessKey  数据id
// billmajortype 模块类型
// billtype 单据类型
export const startProcess = async (data: object) => {
  return await request.post({
    url: '/api/act/task/startProcess',
    data: data
  })
}

// 审核
export const sendWork = async (data: object) => {
  return await request.post({
    url: '/api/act/task/sendWork',
    data: data
  })
}

// 退回节点查询 
// 业务id businessKey
export const getAct = async (data: object) => {
  return await request.post({
    url: '/api/act/task/getAct',
    data: data,
    headersType: 'application/x-www-form-urlencoded'
  })
}

// 退回
export const returnWork = async (data: object) => {
  return await request.post({
    url: '/api/act/task/returnWork',
    data: data
  })
}

// 取回
export const getBack = async (data: object) => {
  return await request.post({
    url: '/api/act/task/getBack',
    data: data
  })
}

// 获取下一步审核信息
export const getNextInfo = async (data: object) => {
  return await request.post({
    url: '/api/act/task/getNextInfo',
    data: data
  })
}

// 流程记录图
export const getTrack = async (params: object) => {
  return await request.get({
    url: '/act/task/getTrack',
    params
  })
}

// 流程记录
export const getHis = async (params: object) => {
  return await request.get({
    url: '/api/act/task/getHis',
    params
  })
}

// 批量提交审核
export const applyV2 = async (data: object) => {
  return await request.post({
    url: '/bizz/wf/applyV2',
    data: data
  })
}

// 同意审核
export const batchApprove = async (data: object) => {
  return await request.post({
    url: '/bizz/wf/batchApprove',
    data: data
  })
}

// 批量退回审核
export const batchDeny = async (data: object) => {
  return await request.post({
    url: '/bizz/wf/batchDeny',
    data: data
  })
}

// 撤销上报或批量撤销上报
export const revokeAudit = async (data: object) => {
  return await request.post({
    url: '/bizz/wf/revokeAudit',
    data: data
  })
}


// 撤销审核  /{id}/{moduleType}/{busType}
export const undo = async (data: string) => {
  return await request.get({
    url: '/bizz/wf/undo/' + data,
  })
}